package com.smart.upms.sys.feign.fallback;


import com.smart.upms.sys.api.UserApi;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author guxiaobai
 * @date 2018/12/7 15:45
 */
@Component
public class UserApiFallbackFactory implements FallbackFactory<UserApi> {

    @Override
    public UserApi create(Throwable throwable) {
        UserApiFallback userApiFallback = new UserApiFallback();
        userApiFallback.setCause(throwable);
        return userApiFallback;
    }
}
